import ChartPart from './components/Charts';
import Operate from './components/Operate';
import TablePart from './components/Tables';
import { VisualizationContextProvider } from './contexts/VisualizationContext';
import cs from 'classnames';

/*
 * @Description: 统计移交
 * @Author: Zzt
 * @Date: 2022-11-10 14:26:04
 * @LastEditTime: 2022-12-27 17:34:01
 */
const VisualizationMain = (props: any) => {
  const { type, className, condition, segmented, tableList, onChange, data, choiceList, ChangNo } =
    props;
  const { visibleData } = data;

  return (
    <>
      <VisualizationContextProvider>
        <div className={cs('pane-container', className)}>
          <div>
            <Operate
              type={type}
              condition={condition}
              onChange={onChange}
              segmented={segmented}
              choiceList={choiceList}
            />
          </div>
          <div>
            <ChartPart data={data} />
          </div>
          <div>
            {tableList.length > 0 && (
              <TablePart ChangNo={ChangNo} tableList={tableList} data={visibleData} />
            )}
          </div>
        </div>
      </VisualizationContextProvider>
    </>
  );
};
export default VisualizationMain;
